package yunwo.cn.yzstation.presenter;

import yunwo.cn.yzstation.api.OrderDetailsModel;
import yunwo.cn.yzstation.api.OrderDetailsView;
import yunwo.cn.yzstation.base.BasePresenter;
import yunwo.cn.yzstation.bean.OrderDetailsBean;
import yunwo.cn.yzstation.model.OrderDetailsActivityModel;
import yunwo.cn.yzstation.view.activity.OrderDetailsActivity;

/**
 * Created by lao on 2017/9/14.
 */

public class OrderDetailsPersenter extends BasePresenter<OrderDetailsView> implements OrderDetailsModel {

    OrderDetailsActivity orderDetailsActivity;
    OrderDetailsView orderDetailsView;
    private final OrderDetailsActivityModel mOrderDetailsActivityModel;

    public OrderDetailsPersenter(OrderDetailsActivity orderDetailsActivity, OrderDetailsView orderDetailsView) {
        attachView(orderDetailsView);
        this.orderDetailsActivity = orderDetailsActivity;
        this.orderDetailsView = orderDetailsView;
        mOrderDetailsActivityModel = new OrderDetailsActivityModel(orderDetailsActivity,this);
    }

    public void getDetailsData(String trackingId) {
        mOrderDetailsActivityModel.getDatailsData(trackingId);
    }

    @Override
    public void getOrderDetailsSuccess(OrderDetailsBean.DataBean dataBean) {
        orderDetailsView.getOrderDetailsSuccess(dataBean);
    }
}
